package com.hao.project.service;

import com.hao.project.model.dto.team.*;
import com.hao.project.model.entity.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hao.project.model.entity.User;
import com.hao.project.model.vo.TeamUserVO;

import java.util.List;

/**
 * @author haoge
 * @description 针对表【team(队伍)】的数据库操作Service
 * @createDate 2023-05-18 09:25:01
 */
public interface TeamService extends IService<Team> {
    /**
     * 创建队伍
     * @param team
     * @param loginUser
     * @return
     */
    long addTeam(Team team, User loginUser);

    /**
     * 搜索队伍
     * @param teamQuery
     * @return
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery,boolean isAdmin);

    /**
     * 更新队伍
     * @param teamUpdateRequest
     * @param loginUser
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest,User loginUser);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @param loginUser
     * @return
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest,User loginUser);

    /**
     * 退出队伍
     * @param teamQuitRequest
     * @param loginUser
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 解散队伍
     * @param teamId
     * @param loginUser
     * @return
     */
    boolean deleteTeam(Long teamId, User loginUser);
}
